/*
 Navicat Premium Data Transfer

 Source Server         : 00-docker-postgres
 Source Server Type    : PostgreSQL
 Source Server Version : 130004
 Source Host           : localhost:54321
 Source Catalog        : test
 Source Schema         : public

 Target Server Type    : PostgreSQL
 Target Server Version : 130004
 File Encoding         : 65001

 Date: 19/10/2021 14:00:20
*/


-- ----------------------------
-- Sequence structure for traffic_cameras_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "public"."traffic_cameras_id_seq";
CREATE SEQUENCE "public"."traffic_cameras_id_seq"
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "public"."traffic_cameras_id_seq" OWNER TO "postgres";

-- ----------------------------
-- Sequence structure for traffic_event_code_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "public"."traffic_event_code_id_seq";
CREATE SEQUENCE "public"."traffic_event_code_id_seq"
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "public"."traffic_event_code_id_seq" OWNER TO "postgres";

-- ----------------------------
-- Sequence structure for traffic_lane_code_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "public"."traffic_lane_code_id_seq";
CREATE SEQUENCE "public"."traffic_lane_code_id_seq"
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "public"."traffic_lane_code_id_seq" OWNER TO "postgres";

-- ----------------------------
-- Sequence structure for traffic_road_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "public"."traffic_road_id_seq";
CREATE SEQUENCE "public"."traffic_road_id_seq"
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "public"."traffic_road_id_seq" OWNER TO "postgres";

-- ----------------------------
-- Sequence structure for user_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "public"."user_id_seq";
CREATE SEQUENCE "public"."user_id_seq"
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "public"."user_id_seq" OWNER TO "postgres";

-- ----------------------------
-- Table structure for traffic_cameras
-- ----------------------------
DROP TABLE IF EXISTS "public"."traffic_cameras";
CREATE TABLE "public"."traffic_cameras" (
  "id" int4 NOT NULL DEFAULT nextval('traffic_cameras_id_seq'::regclass),
  "camera_id" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "camera_name" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "camera_type" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "camera_lonlat" varchar(255) COLLATE "pg_catalog"."default",
  "camera_road_id" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "camera_position" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "camera_scene" varchar(255) COLLATE "pg_catalog"."default",
  "camera_video_url" varchar(255) COLLATE "pg_catalog"."default",
  "camera_original_image_url" varchar(255) COLLATE "pg_catalog"."default",
  "camera_image_url" varchar(255) COLLATE "pg_catalog"."default",
  "created_at" timestamp(6) NOT NULL,
  "updated_at" timestamp(6) NOT NULL
)
;
ALTER TABLE "public"."traffic_cameras" OWNER TO "postgres";

-- ----------------------------
-- Records of traffic_cameras
-- ----------------------------
BEGIN;
INSERT INTO "public"."traffic_cameras" VALUES (5, '18a6ee1a-4473-4c10-aaa9-96c1518fc3ec', '珠山湖大道和枫树二路交叉口南侧监控摄像头', '枪球机', '', '0add4d', 'south', '', '', 'http://39.99.145.119:18000/api/traffic_files/previewfile/south.png', '', '2021-09-15 17:25:14', '2021-09-15 17:21:03');
INSERT INTO "public"."traffic_cameras" VALUES (6, '1225b79e-45ee-42dd-891f-c072d8d0bfb6', '珠山湖大道和枫树二路交叉口东侧监控摄像头', '枪球机', '', '0add4d', 'east', '', '', 'http://39.99.145.119:18000/api/traffic_files/previewfile/east.png', '', '2021-09-15 17:26:13', '2021-09-15 17:21:03');
INSERT INTO "public"."traffic_cameras" VALUES (7, 'a1ac4db4-8bee-4267-8d0a-71d2f2552c1a', '珠山湖大道和枫树二路交叉口西侧监控摄像头', '枪球机', '', '0add4d', 'west', '', '', 'http://39.99.145.119:18000/api/traffic_files/previewfile/west.png', '', '2021-09-15 17:26:36', '2021-09-15 17:21:03');
INSERT INTO "public"."traffic_cameras" VALUES (4, 'f483939b-6534-40d8-91c8-00329fe21100', '珠山湖大道和枫树二路交叉口北侧监控摄像头', '枪球机', '', '0add4d', 'north', '', '', 'http://39.99.145.119:18000/api/traffic_files/previewfile/north.png', '', '2021-09-15 17:24:17', '2021-09-18 15:04:52');
COMMIT;

-- ----------------------------
-- Table structure for traffic_event_code
-- ----------------------------
DROP TABLE IF EXISTS "public"."traffic_event_code";
CREATE TABLE "public"."traffic_event_code" (
  "id" int4 NOT NULL DEFAULT nextval('traffic_event_code_id_seq'::regclass),
  "event_value" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "event_label" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "created_at" timestamp(6) NOT NULL,
  "updated_at" timestamp(6) NOT NULL
)
;
ALTER TABLE "public"."traffic_event_code" OWNER TO "postgres";

-- ----------------------------
-- Records of traffic_event_code
-- ----------------------------
BEGIN;
INSERT INTO "public"."traffic_event_code" VALUES (1, '2001', '车辆逆行', '2021-09-10 17:08:47.361303', '2021-09-10 18:22:37');
INSERT INTO "public"."traffic_event_code" VALUES (3, '2002', '违章停车', '2021-09-10 18:22:53.606843', '2021-09-10 18:22:53.606848');
INSERT INTO "public"."traffic_event_code" VALUES (4, '2003', '道路拥堵', '2021-09-10 18:23:05.996456', '2021-09-10 18:23:05.996553');
INSERT INTO "public"."traffic_event_code" VALUES (5, '2004', '道路缓行', '2021-09-10 18:23:17.763246', '2021-09-10 18:23:17.763253');
INSERT INTO "public"."traffic_event_code" VALUES (6, '2006', '行人入侵', '2021-09-10 18:23:27.741883', '2021-09-10 18:23:27.741888');
INSERT INTO "public"."traffic_event_code" VALUES (7, '2005', '异常变道', '2021-09-10 18:23:48.065462', '2021-09-10 18:23:48.065468');
INSERT INTO "public"."traffic_event_code" VALUES (8, '2007', '抛洒物', '2021-09-10 18:24:11.355312', '2021-09-10 18:24:11.35532');
INSERT INTO "public"."traffic_event_code" VALUES (9, '2008', '占用应急车道', '2021-09-15 17:21:54.303267', '2021-09-15 17:21:54.303273');
INSERT INTO "public"."traffic_event_code" VALUES (10, '2009', '占用公交车道', '2021-09-15 17:22:21.313057', '2021-09-15 17:22:21.313064');
COMMIT;

-- ----------------------------
-- Table structure for traffic_lane_code
-- ----------------------------
DROP TABLE IF EXISTS "public"."traffic_lane_code";
CREATE TABLE "public"."traffic_lane_code" (
  "id" int4 NOT NULL DEFAULT nextval('traffic_lane_code_id_seq'::regclass),
  "lane_value" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "lane_label" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "created_at" timestamp(6) NOT NULL,
  "updated_at" timestamp(6) NOT NULL
)
;
ALTER TABLE "public"."traffic_lane_code" OWNER TO "postgres";

-- ----------------------------
-- Records of traffic_lane_code
-- ----------------------------
BEGIN;
INSERT INTO "public"."traffic_lane_code" VALUES (1, '1001', '左转车道', '2021-09-10 17:18:54.021801', '2021-09-10 18:18:12');
INSERT INTO "public"."traffic_lane_code" VALUES (3, '1002', '右转车道', '2021-09-10 18:18:26.123438', '2021-09-10 18:18:26.123446');
INSERT INTO "public"."traffic_lane_code" VALUES (4, '1003', '直行车道', '2021-09-10 18:18:38.505871', '2021-09-10 18:18:38.505878');
INSERT INTO "public"."traffic_lane_code" VALUES (5, '1004', '左转和直行车道', '2021-09-10 18:18:53.805768', '2021-09-10 18:18:53.805774');
INSERT INTO "public"."traffic_lane_code" VALUES (6, '1005', '右转和直行车道', '2021-09-10 18:19:08.603429', '2021-09-10 18:19:08.603435');
INSERT INTO "public"."traffic_lane_code" VALUES (7, '1006', '全向车道', '2021-09-10 18:19:46.645965', '2021-09-10 18:19:46.645969');
INSERT INTO "public"."traffic_lane_code" VALUES (10, '1009', '非机动车道', '2021-09-10 18:21:03.822068', '2021-09-10 18:21:03.822076');
COMMIT;

-- ----------------------------
-- Table structure for traffic_road
-- ----------------------------
DROP TABLE IF EXISTS "public"."traffic_road";
CREATE TABLE "public"."traffic_road" (
  "id" int4 NOT NULL DEFAULT nextval('traffic_road_id_seq'::regclass),
  "road_id" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "road_name" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "road_lonlat" varchar(255) COLLATE "pg_catalog"."default",
  "created_at" timestamp(6) NOT NULL,
  "updated_at" timestamp(6) NOT NULL
)
;
ALTER TABLE "public"."traffic_road" OWNER TO "postgres";

-- ----------------------------
-- Records of traffic_road
-- ----------------------------
BEGIN;
INSERT INTO "public"."traffic_road" VALUES (4, '0add4d', '硃山湖大道和枫树二路交叉口', '114.134965,30.466782', '2021-09-15 17:19:34.959384', '2021-09-15 17:19:46');
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS "public"."user";
CREATE TABLE "public"."user" (
  "id" int4 NOT NULL DEFAULT nextval('user_id_seq'::regclass),
  "username" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "user_phone" varchar(255) COLLATE "pg_catalog"."default",
  "email" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "user_id" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "salt" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "hashed_password" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "bio" varchar(255) COLLATE "pg_catalog"."default",
  "image" varchar(255) COLLATE "pg_catalog"."default",
  "created_at" timestamp(6) NOT NULL,
  "updated_at" timestamp(6) NOT NULL
)
;
ALTER TABLE "public"."user" OWNER TO "postgres";

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO "public"."user" VALUES (2, 'string', NULL, 'user@example.com', 'aea29848-201f-11ec-a3e4-f218989b1433', '$2b$12$jxPK6MZW2ubIjxAZYJ9mUe', '$2b$12$bmVlSV2DYZ2OUs/Q5wHz2.d9X1V4S7sK3KxbuRSCCLLxHV4TfslUi', '用户_aea29b', NULL, '2021-09-28 13:52:30.648211', '2021-09-28 13:52:30.648217');
COMMIT;

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "public"."traffic_cameras_id_seq"
OWNED BY "public"."traffic_cameras"."id";
SELECT setval('"public"."traffic_cameras_id_seq"', 10, true);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "public"."traffic_event_code_id_seq"
OWNED BY "public"."traffic_event_code"."id";
SELECT setval('"public"."traffic_event_code_id_seq"', 12, true);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "public"."traffic_lane_code_id_seq"
OWNED BY "public"."traffic_lane_code"."id";
SELECT setval('"public"."traffic_lane_code_id_seq"', 12, true);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "public"."traffic_road_id_seq"
OWNED BY "public"."traffic_road"."id";
SELECT setval('"public"."traffic_road_id_seq"', 8, true);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "public"."user_id_seq"
OWNED BY "public"."user"."id";
SELECT setval('"public"."user_id_seq"', 4, true);

-- ----------------------------
-- Primary Key structure for table traffic_cameras
-- ----------------------------
ALTER TABLE "public"."traffic_cameras" ADD CONSTRAINT "traffic_cameras_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table traffic_event_code
-- ----------------------------
ALTER TABLE "public"."traffic_event_code" ADD CONSTRAINT "traffic_event_code_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table traffic_lane_code
-- ----------------------------
ALTER TABLE "public"."traffic_lane_code" ADD CONSTRAINT "traffic_lane_code_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table traffic_road
-- ----------------------------
CREATE UNIQUE INDEX "traffic_road_road_id" ON "public"."traffic_road" USING btree (
  "road_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table traffic_road
-- ----------------------------
ALTER TABLE "public"."traffic_road" ADD CONSTRAINT "traffic_road_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table user
-- ----------------------------
ALTER TABLE "public"."user" ADD CONSTRAINT "user_pkey" PRIMARY KEY ("id");
